/**
 *  @file Include this file to use Fpk's method of starting the program.
 *        This method is untested.
 */

// Have include guard.
#ifndef START_H
#define START_H

#include "WPILib.h"

/**
 *  Place your own start up code in your implementation of 
 *  this function.
 */
INT32 Start();

extern "C"
{
	INT32 FRC_UserProgram_StartupLibraryInit()
	{
		printf("Fpk: Fpk Version \"Fail\"\n");
		return Start();
	}
}

template<typename Robot>
Robot *CreateRobot()
{
	/* The following code in this block is derived from 
	 * WPILib, which is licenced under the licence in the 
	 * file "Licence-WPILib.txt" inside the project directory.
	 */
	
	return new Robot();
}

template<typename Robot>
void StartRobot()
{
	/* The following code in this block is derived from 
	 * WPILib, which is licenced under the licence in the 
	 * file "Licence-WPILib.txt" inside the project directory.
	 */
	
	RobotBase::startRobotTask((FUNCPTR)(Robot*(*)())CreateRobot<Robot>);
}

#endif // #ifndef START_H
